package com.gary.springcloud.service;

import com.gary.springcloud.entity.CommonResult;
import com.gary.springcloud.entity.Payment;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.concurrent.TimeUnit;

/**
 * @author peng_rui
 * @date 2022/4/10
 */
@Service
@FeignClient(name = "CLOUD-PROVIDER-HYSTRIX-PAYMENT", fallback = PaymentFallbackService.class)
public interface PaymentService {

    /**
     * ok
     * @return
     */
    @GetMapping(value = "/provider/hystrix/ok")
    CommonResult<String> hystrixOk();

    /**
     * timeout
     * @return
     */
    @GetMapping(value = "/provider/hystrix/timeout")
    CommonResult<String> hystrixTimeout();
}
